<template>
    <div>
        <el-card class="box-card">
            <template #header>
                <div class="card-header">
                    <span>订单管理</span>
                </div>
            </template>
            <Tables :tableData="tableList.list" :headers="tableList.headers" />
            <br>
            <!-- 分页器 -->
            <!-- <el-pagination v-model:current-page="currentPage" v-model:page-size="pageSize" :page-sizes="[1, 5, 10, 15]"
                layout="total, sizes, prev, pager, next, jumper" :total="totalNum" @size-change="handleSizeChange"
                @current-change="handleCurrentChange" /> -->
        </el-card>
    </div>
</template>

<script setup lang="ts">
import Tables from "@/components/Tables.vue";
// 引入请求 订单列表
// import { accGetOrder_api } from "../../api/apis.ts"

// 引入分页的hooks---------------------
// import { usePagination } from "../../hooks/usePagination.ts";
// // 解构分页的函数
// let { totalNum,//总条数
//     pageSize,//显示个数
//     currentPage,//当前页
//     handleCurrentChange,
//     handleSizeChange } = usePagination(getData);
// ----------------------------------

import { ref } from "vue";
let tableList: any = ref({
    list: [
        // {
        //     date: '2015-1-1',
        //     id:3,
        //     orderNo: "11014",
        //     orderTime: "2020-04-08T02:44:49.000Z",
        //     phone: "18181358998",
        //     consignee: "赵子龙",
        //     deliverAddress: "天府新谷3",
        //     deliveryTime: "2020-04-23T02:44:47.000Z",
        //     remarks: "微辣",
        //     orderAmount: 99.88,
        //     orderState: "已完成"
        // },
        // {
        //     date: '2015-1-1',
        //     id:3,
        //     orderNo: "11014",
        //     orderTime: "2020-04-08T02:44:49.000Z",
        //     phone: "18181358998",
        //     consignee: "赵子龙",
        //     deliverAddress: "天府新谷3",
        //     deliveryTime: "2020-04-23T02:44:47.000Z",
        //     remarks: "微辣",
        //     orderAmount: 99.88,
        //     orderState: "已完成"
        // },
        // {
        //     date: '2015-1-1',
        //     id:3,
        //     orderNo: "11014",
        //     orderTime: "2020-04-08T02:44:49.000Z",
        //     phone: "18181358998",
        //     consignee: "赵子龙",
        //     deliverAddress: "天府新谷3",
        //     deliveryTime: "2020-04-23T02:44:47.000Z",
        //     remarks: "微辣",
        //     orderAmount: 99.88,
        //     orderState: "已完成"
        // }

    ],
    // 表头数据
    headers: {
        date: "日期",
        orderNo: "订单号",
        consignee: "用户名",
        phone: "手机号",
        edit: "操作"
    }
})

function getData() {
    //     let res = await accGetOrder_api({
    //         currentPage: currentPage.value,
    //         pageSize: pageSize.value
    //     })
    //     console.log(res);
    let res = ref({
        data: [
            {
                date: '2015-1-1',
                id: 3,
                orderNo: "11014",
                orderTime: "2020-04-08T02:44:49.000Z",
                phone: "18181358998",
                consignee: "赵子龙",
                deliverAddress: "天府新谷3",
                deliveryTime: "2020-04-23T02:44:47.000Z",
                remarks: "微辣",
                orderAmount: 99.88,
                orderState: "已完成"

            },
            {
                date: '2015-1-1',
                id: 3,
                orderNo: "11014",
                orderTime: "2020-04-08T02:44:49.000Z",
                phone: "18181358998",
                consignee: "赵子龙",
                deliverAddress: "天府新谷3",
                deliveryTime: "2020-04-23T02:44:47.000Z",
                remarks: "微辣",
                orderAmount: 99.88,
                orderState: "已完成"

            },
            {
                date: '2015-1-1',
                id: 3,
                orderNo: "11014",
                orderTime: "2020-04-08T02:44:49.000Z",
                phone: "18181358998",
                consignee: "赵子龙",
                deliverAddress: "天府新谷3",
                deliveryTime: "2020-04-23T02:44:47.000Z",
                remarks: "微辣",
                orderAmount: 99.88,
                orderState: "已完成"

            },
        ]
    })
    console.log(tableList.value.list);

    console.log(res.value.data);

    tableList.value.list = res.value.data
}
// // 初始化调用函数
getData();

</script>

<style scoped lang="scss"></style>